[//

async function( kuo,Context,context){
    let func_ = kuo.func_.toUpperCase();
    Context.headers["content-type"] = 'application/json; charset=UTF-8';
    let $DATA = Object.assign({},this.$DATA);
    if(Kuo_admin[func_]){
    
        let $Security = await Mem.Get("session/"+kuo.sessionid);
        if(! $Security ){
            $Security ={ adminid: 0};
        }

        if(typeof($Security['adminid']) == "undefined" ){
            $Security['adminid'] = 0;
        }

        if(ADMINSafety != ""){
            if($Security){
                if(typeof($Security['num']) != "undefined" && $Security['num'] > 3){
                    $DATA.code = -1;
                    $DATA.msg = "Security filtering !!!";
                    Context.body =JSON.stringify($DATA);
                    return ;
                }
            }
            if( !$Security || $Security['security'] != ADMINSafety ){
                if( typeof(kuo.get['security']) != "undefined" ){
                    if(!$Security){
                        $Security ={
                            'security':"",
                            'agent':"",
                            'ip':"",
                            'num' : 0,
                            'securitytime':0
                        };
                    }
                    if( kuo.get['security'] == ADMINSafety){
                        $Security['security'] = ADMINSafety;
                        $Security['agent'] =kuo.agent;
                        $Security['ip'] = kuo.ip;
                        $Security['num'] =0;
                        Context.statusCode = 302;
                        Context.headers["Location"] = "?";
                        Context.body ="";
                        Mem.Put("session/"+kuo.sessionid,$Security,Expiredseconds);
                        return ;
                    }else{
                        $Security['num'] = $Security['num']*1+1;
                        Mem.Put("session/"+kuo.sessionid,$Security,Expiredseconds);
                    }
                }
                $DATA.code = -1;
                $DATA.msg = "Security filtering !!";
                Context.body =JSON.stringify($DATA);
   
                return ;
            }
    
            if(typeof($Security['agent']) == "undefined" || kuo.agent != $Security['agent']){
                Mem.Del("session/"+kuo.sessionid);
                $DATA.code = -1;
                $DATA.msg = "Security filtering agent!";
                Context.body =JSON.stringify($DATA);
                
                return ;
            }
    
            if($Security && typeof($Security['adminid']) != "undefined" &&  $Security['adminid'] > 0){
                let $ADMIN = await Adminid($Security['adminid']);
                if($ADMIN){
                    if( $ADMIN['verifyip'] == '1'){
                        if($Security['ip'] != kuo.ip){
                            Mem.Del("session/"+kuo.sessionid);
                            $DATA.code = -1;
                            $DATA.msg = "Security filtering ip!";
                            Context.body =JSON.stringify($DATA);
                            return ;
                        }
                    }
                }
            }
        }
    
        if(kuo.func_ != "login" && kuo.func_  != "home" && kuo.func_ != 'quite'){
            
            let fan = await this.Loginok(kuo,$Security);
            if(fan){
                $DATA.code = fan;
                $DATA.msg = "Insufficient permissions";
                if($Security['adminid'] > 0){
                    let $hash = 'safetoken/'+$Security['adminid'];
                    $DATA.token = Mode("Tools").Uuid();
                    await Mem.Set($hash,$DATA.token);
                }
                Context.body = JSON.stringify($DATA);
                return ;
            }
        }
        kuo.adminid = $Security['adminid'];
        await Kuo_admin[func_](kuo,Context,context);
        return "";
    }
    $DATA.code = -1;
    $DATA.msg ="Not "+func_;

    Context.body = JSON.stringify($DATA);;
}

]